package collections;

import java.util.*;

public class Search1
{
    public static void main(String args[])
    {
        List list = new ArrayList();
        Random rn = new Random();

        for (int i = 1; i <= 25; i++)
        {
            int n = (int) (rn.nextFloat() * 10 + 1);
            Integer ival = new Integer(n);
            int pos = Collections.binarySearch(list, ival);
            if (pos < 0)
                list.add(-pos - 1, ival);
        }

        Iterator iter = list.iterator();
        while (iter.hasNext())
            System.out.println(iter.next());
    }
}
